/**
 * 
 */
package liveSimBE;

import java.applet.Applet;
import netscape.javascript.JSObject;

/**
 * @author Kenneth Arnold
 *
 */
public class LiveSimBE extends Applet {
  public static Circuit getCircuit() {
    return new Circuit();
  }
  
	public static String testStr() {
		return "LiveSim";
	}
	
	@Override
	public void start() {
		Object[] args = {this};
		JSObject.getWindow(this).call("appletLoaded", args);
		super.start();
	}

	public static int addOne(int x) {
		return x+1;
	}
	
	public static double halve(double x) {
		return x/2;
	}
	
	public static double mysum(Double[] in) {
		double s=0;
		for (double d : in)
			s += d;
		return s;
	}
	
	public static Double[] dup(double in) {
		Double[] ret = new Double[3];
		for(int i=0; i<3; i++) ret[i] = in;
		return ret;
	}
	
	public static Double[] vals(Double[] in) {
		Double[] ret = new Double[3];
		ret[0] = in[2];
		ret[1] = in[1];
		ret[2] = in[0];
		return ret;
	}
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

}
